/*
 * Copyright 2012 the original author or authors.
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 * 
 */
package org.chacha.context;


import org.chacha.entity.AuthRequest;
import org.chacha.entity.AuthResponse;

/**
 * 
 *	@author: hejing
 *	@date: 2012-11-5-下午06:47:27
 */
public interface LoginContext {
	/**
	 * 密码认证
	 * @param req 密码认证请求
	 * @return 认证成功或失败，若认证成功根据action要求决定是否返回令牌
	 */
	public AuthResponse login(AuthRequest req);
	/**
	 * 令牌认证
	 * @param req 令牌认证请求
	 * @return 认证是否成功
	 */
	public AuthResponse loginToken(AuthRequest req);
	/**
	 * 令牌注销，登出
	 * @param req
	 * @return 令牌注销结果
	 */
	public AuthResponse logout(AuthRequest req);
}
